<div class="topic-list-contents">
  {{#discovery-topics-list model=model refresh=(action "refresh") as |discoveryTopicList|}}
    {{#if hasTopics}}
      {{topic-list
        top=top
        showTopicPostBadges=showTopicPostBadges
        showPosters=true
        canBulkSelect=canBulkSelect
        changeSort=(action "changeSort")
        toggleBulkSelect=(action "toggleBulkSelect")
        hideCategory=model.hideCategory
        order=order
        ascending=ascending
        bulkSelectEnabled=bulkSelectEnabled
        selected=selected
        expandGloballyPinned=expandGloballyPinned
        expandAllPinned=expandAllPinned
        category=category
        topics=model.topics
        discoveryList=true
        scrollOnLoad=true
        onScroll=discoveryTopicList.saveScrollPosition}}
    {{/if}}
  {{/discovery-topics-list}}
</div>

{{#if showSidebar}}
  <div class="sidebar">
    {{#if showSidebarTopics}}
      <div class="sidebar-title">
        {{i18n 'news.sidebar_topics_title'}}
      </div>
      <ul>
        {{#each sidebarTopics as |topic|}}
          <li>
            <div class="sidebar-topic-title">{{topic-link topic}}</div>
            <div class="sidebar-topic-meta">
              <span>{{format-date topic.bumpedAt leaveAgo="true"}}</span>
              <span>{{i18n 'changed_by' author=topic.creator.username}}</span>
              {{#if topic.category}}
                <span>{{{i18n 'in_category' basicCategoryLink=topic.basicCategoryLinkHtml}}}</span>
              {{/if}}
            </div>
          </li>
        {{/each}}
      </ul>
    {{/if}}
  </div>
{{/if}}